package com.edmendst.xmall.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CorsConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("http://localhost:5177", "https://elv68fqluraj.ngrok.xiaomiqiu123.top","https://4504w8vzbaf3.ngrok.xiaomiqiu123.top","http://localhost:63342")
                .allowedHeaders("*")
                .allowCredentials(true)
                .allowedMethods("*");
    }
}
